package com.cdream.basic.algorithm.leetcode.twoPointer;

/**
 * @author cdream
 * @date 5/15/21
 */
public class Question344 {
    public static void swap(char[] arr, int i, int j) {
        char temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }

    public void reverseString(char[] s) {
        int start = 0;
        int end = s.length - 1;
        while (end > start) {
            swap(s, start++, end--);
        }
    }
}
